package com.yoga.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yoga.dao.CourseMapper;
import com.yoga.model.Course;
import com.yoga.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yan
 * @date 2025/8/16
 */
@Service
public class CourseServiceImpl implements CourseService {
    private CourseMapper courseMapper;
    @Autowired
    public void setCourseMapper(CourseMapper courseMapper) {
        this.courseMapper = courseMapper;
    }


    @Override
    public Page<Course> findAll(Page<Course> page,Course course) {
        return courseMapper.findAll(page,course);
    }


    @Override
    public boolean add(Course course) {
        return courseMapper.insert(course) > 0;
    }

    @Override
    public boolean update(Course course) {
        return courseMapper.updateById(course) > 0;
    }

    @Override
    public List<Course> findAlls() {
        return courseMapper.findAlls();
    }

    @Override
    public int deleteByIds(List<Integer> ids) {
        return courseMapper.deleteByIds(ids);
    }
}
